package com.yannuo.mapper;

import com.yannuo.entiy.Dept;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DeptMapper {

    @Results({
            @Result(property = "deptno",column = "deptno"),
            @Result(property = "dname",column = "dname"),
            @Result(property = "loc",column = "loc"),
            @Result(property = "empList",column = "deptno",many = @Many(select = "com.yannuo.mapper.EmpMapper.getEmpByDeptno"))
    })
    @Select("select * from dept")
    public List<Dept> getAllDepts();
}
